package com.codingfuture.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @Author kobe
 * @Date 2021/11/5 16:41
 * @Description
 */
@Controller
public class LoginController {

    @RequestMapping("/login")
    public void login(HttpSession session) {
        String username = "zs";
        session.setAttribute("username", username);
        System.out.println(session.getId());
    }

    @RequestMapping("/quit")
    public void quit(HttpSession session) {
        session.removeAttribute("username");
    }
}
